package Pantallas;

import net.rim.device.api.system.Bitmap;
import net.rim.device.api.ui.Graphics;
import net.rim.device.api.ui.Manager;
import net.rim.device.api.ui.component.SeparatorField;
import net.rim.device.api.ui.container.HorizontalFieldManager;
import net.rim.device.api.ui.container.MainScreen;
import net.rim.device.api.ui.container.VerticalFieldManager;
import GUI.MyCustomButton;

public class Pantalla extends MainScreen{

	protected VerticalFieldManager vfm;
	protected static VerticalFieldManager headerManager;
	protected HorizontalFieldManager hfm;
	/**
	 * 
	 */
	protected Pantalla(){
		vfm = new VerticalFieldManager();
        hfm = new HorizontalFieldManager();
        iniciarHeader();
	}
	/**
	 * 
	 */
	private void iniciarHeader(){
    	headerManager = new VerticalFieldManager( Manager.USE_ALL_WIDTH | Manager.FIELD_HCENTER) {
			public void paint(Graphics graphics) 
            {
			   
			   Bitmap backgroundBitmap = Bitmap.getBitmapResource("log.jpg");
               //Draw the background image and then call paint.
               graphics.drawBitmap(0, 0, backgroundBitmap.getWidth(), backgroundBitmap.getHeight(), backgroundBitmap,0, 0);
                super.paint(graphics);
            }			
		};
        // Set the displayed title of the screen   
    	MyCustomButton mcb1 = new MyCustomButton("50x50.gif",70,70);
    	headerManager.add(mcb1);
    	headerManager.add(new SeparatorField());
        setTitle(headerManager);
    }
}
